﻿<%@ Page Title="" EnableEventValidation="true" Theme="Alpha" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="TeamList.aspx.cs" Inherits="App.TeamList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <h1>Najít tým</h1>
        <asp:Label ID="LabelInfo" runat="server" Text="" CssClass="formMessage" Visible="false"></asp:Label> 
        <div class="formSelect">
            <asp:Label ID="Label10" runat="server" Text="Najít tým podle: "></asp:Label>
            <asp:DropDownList ID="DropDownListFilter" runat="server" AutoPostBack="true"  >
                <asp:ListItem Selected="True">Název týmu</asp:ListItem>
                <asp:ListItem>Lokace</asp:ListItem>
                <asp:ListItem>Zakladatel</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="formField">
            <asp:Label ID="Label1" runat="server" Text="Hledaný výraz: "></asp:Label>
            <asp:TextBox ID="TextBoxSearch" runat="server" ></asp:TextBox>
            <ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="TextBoxSearch" MinimumPrefixLength="1" ServiceMethod="GetTeamNames"
                CompletionInterval="200" EnableCaching="true" CompletionSetCount="15" CompletionListHighlightedItemCssClass="hightlight"></ajaxToolkit:AutoCompleteExtender>
        </div>
        <div class="formButton" style="margin-bottom: 25px;">
            <asp:Button ID="ButtonFilter" runat="server" Text="Najdi" onclick="ButtonFilter_Click"/>
        </div>
        <asp:Repeater ID="RepeaterTeams" runat="server">
            <HeaderTemplate>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="listItem">
                    <ajaxToolkit:Gravatar ID="ImageAvatar3" runat="server" DefaultImageBehavior="Identicon" Email="<%#AssignTeamID(Container.DataItem)%>" DefaultImage="<%#AssignTeamAvatar(Container.DataItem)%>"/>
                    <asp:LinkButton ID="LinkButtonTeamInfo" runat="server" CommandArgument='<%#Eval("TeamID")%>' OnClick="LinkButtonTeamInfo_Click"><%#Eval("TeamName")%></asp:LinkButton>
                    <asp:Label ID="Label2" runat="server"><%#Eval("Location")%></asp:Label>
                    <asp:LinkButton ID="LinkButtonJoin" runat="server" CssClass="button"  Visible='<%#IsRelatedToTeam(Container.DataItem)%>' CommandArgument='<%#Eval("TeamID")%>' OnClick="LinkButtonJoin_Click">Přidat se</asp:LinkButton>
                    <asp:Label ID="LabelInfo" runat="server" Text='<%#GetLinkButtonDescription(Container.DataItem)%>' Visible='<%#!IsRelatedToTeam(Container.DataItem)%>' CssClass="member"></asp:Label>
                </div>
            </ItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:Repeater>
        <asp:Label ID="lblEmptyRepeaterText" runat="server" Text="Žádné týmy nenalezeny." Visible="false"></asp:Label>
            
        

    </asp:Panel>
</asp:Content>
